{% extends "../main.html" %}

{% block head %}
{% endblock %}

{% block breadcrumb %}
<nav>
    <ul id="crumbs">
        <li><a href="/">{{ system_title }}</a></li>
        <li>{{ str.questionaries }}</li>
    </ul>
</nav>
{% endblock %}

{% block content %}

<section id="wide_content">
    <div class="table" style="margin-bottom:10px;">

        {% for q in questionaries %}
        <div class="table_row" alt="{{ q.key }}">
            <div class="table_cell">
                {{ q.name.translate }}<br />
                <span style="color: gray; font-size:11px;">{{ q.description.translate }}</span>
            </div>
            <div class="table_cell" style="text-align:center; vertical-align: middle; white-space: nowrap;">
                {{ q.start_date|date:"d.m.Y" }} - {{ q.end_date|date:"d.m.Y" }}
            </div>
            <a href="/questionary/{{ q.key }}" class="table_cell buttons" style="width:20px; height:25px; background: url('/images/edit.png') center center no-repeat;">
            </a>
        </div>
        {% endfor %}

        {% include "1questionary_edit.html" %}
    </div>
    <a href="/questionary/" class="button" style="float:right;">{{ str.add_new }}</a>
</section>

<script type="text/javascript">
    $(document).ready(function(){
        $(".table_row").dblclick(function() {
            key = $(this).attr('alt');
            location.href = '/questionary/' + key;
            return false;
        });
    });
</script>

{% endblock %}